package com.woniuxy.store.app.apiImpl;

import cn.hutool.core.bean.BeanUtil;
import com.woniuxy.cloud.mall95.log.Log;
import com.woniuxy.store.client.StoreQueryClient;
import com.woniuxy.store.client.param.SearchApplyParam;
import com.woniuxy.store.client.result.ApplyDto;
import com.woniuxy.store.client.result.StoreInfoDto;
import com.woniuxy.store.infra.model.StoreApplay;
import com.woniuxy.store.service.StoreApplayService;
import com.woniuxy.store.service.param.SearchApplyServiceParam;
import common.WoniuPage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import result.Result;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

@RestController
@RequestMapping("/store/manage")
public class StoreQueryClientImpl implements StoreQueryClient {

    @Resource
    private StoreApplayService storeApplayService;

    @Override
    @Log("查询开店申请")
    public Result searchApply(@Valid SearchApplyParam param) {
        SearchApplyServiceParam param1 = BeanUtil.toBean(param, SearchApplyServiceParam.class);
        WoniuPage<StoreApplay> woniuPage = storeApplayService.searchApply(param1);
        System.out.println(woniuPage.getList());
        return Result.success(woniuPage);

    }
}
